#pragma once

#include <string>

class Component
{
public:
    virtual ~Component() = default;

public:
    virtual std::string operation() const = 0;
};

class ConcreteComponent : public Component
{
public:
    std::string operation() const override
    {
        return "ConcreteComponent";
    }
};

class Decorator : public Component
{
public:
    Decorator(Component *component)
    {
        m_component = component;
    }

    std::string operation() const override
    {
        return this->m_component->operation();
    }

protected:
    Component *m_component;
};

class ConcreteDecorator : public Decorator
{
public:
    ConcreteDecorator(Component *component) : Decorator(component)
    {
    }

    std::string operation() const override
    {
        return "ConcreteDecorator(" + Decorator::operation() + ")";
    }
};